<?php
/**
 *  💡 免责声明：本软件不得用于商业用途，仅做学习交流
 *  ⚠️ 权利声明：本软件由版权人提供产品技术支持
 *  📅 项目编号：NX2025-0135
 */
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUserBankCardsTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('user_bank_cards', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('user_id')->comment('用户id');
            $table->string('bank_name', 50)->comment('银行名称');
            $table->string('bank_branch', 100)->comment('支行名称');
            $table->tinyInteger('card_type')->default(1)->comment('-借记卡 2-信用卡 3-对公账户');
            $table->string('card_number')->comment('银行卡号');
            $table->string('card_holder', 50)->comment('持卡人姓名');
            $table->string('id_card_number', 50)->comment('证件号码');
            $table->string('phone', 20)->comment('预留手机号');
            $table->timestamps();
        });
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE `user_bank_cards` comment '用户银行卡'");
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('user_bank_cards');
    }
}
